package com.ws.common.exception;

import com.ws.common.util.ResultCode;

/**
 * Created by WS on 2018/1/26.
 */
public enum MyBaseCodeEnum implements ResultCode {
    NULL_EXCEPTION("950001","参数为空"),
    ;


    private String code;
    private String msg;

    MyBaseCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public String getMsg(String code) {
        for (MyBaseCodeEnum baseCodeEnum : MyBaseCodeEnum.values()) {
            if (baseCodeEnum.getCode().equals(code)){
                return baseCodeEnum.getMsg();
            }
        }
        return null;
    }
}
